(function () {
    var EVENT_CLICK = Laya.Event.CLICK;
    var io = ppt.io;

    function propsSell() {
        propsSell.super(this);
        this.data = null;
        this._num = 1;
        this._layerSp = null;
        this.tradSp = null;
        this.init();
    }
    Laya.class(propsSell, "Com.Props.Sell", ui.Props.PropsSellUI);
    var _proto = propsSell.prototype;

    _proto.init = function () {
        this.sellBtn.on(Laya.Event.CLICK, this, this.sellBtnHave);
    }

    _proto.upData = function (data) {
        this.data = data;
        if (!data) {
            return;
        }
        this.details.getChildByName('titleD').text = this.details.getChildByName('titleS').text = data.name;
        this.details.getChildByName('detailsNum').text = data.count;
        this.details.getChildByName('detailsTxt').text = data.desc;
        this.details.getChildByName('detailsMoney').text = data.sell;
        this.details.getChildByName('picallnext').skin = 'res/props/' + this.data.item_id + '.png';
    }
    _proto.sellBtnHave = function () {
        var data = this.data;
            data.sellNum = 1;
        ppt.director.popScene(new Alert.Sell(this.data));
    }
    _proto.visibleSell = function (data) {
        if (data.length > 0) {
            this.visible = true;

        } else {
            this.visible = false;
        }
    }
})();